package lhy.orm.enums;

/**
 * Created by Caleb Zhou on 2021/10/11.
 */
public enum DatabaseType {
    //
    SQL_SERVER(1,"sqlserver","select @@version"),
    MYSQL(2,"mysql","");
    private final int type;
    private final String jdbcUrl;
    //获取版本号的SQL语句
    private final String versionStmt;

    DatabaseType(int type, String jdbcUrl,String versionStmt){

        this.type=type;
        this.jdbcUrl=jdbcUrl;
        this.versionStmt = versionStmt;
    }
    public int getType(){
        return type;
    }
    public String getJdbcUrl(String ip){
        return "jdbc:"+jdbcUrl+"://"+ip+";";
    }

    public String getVersionStmt() {
        return versionStmt;
    }
}
